package io.renren.modules.canteens.dao;

import io.renren.common.dao.BaseDao;
import io.renren.modules.canteens.dto.BatchOrdertemDTO;
import io.renren.modules.canteens.entity.BatchOrdertemEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 批量采购明临时表 
 *
* @author 翟文闯 619556390@QQ.com
 * @since 1.0.0 2020-01-06
 */
@Mapper
public interface BatchOrdertemDao extends BaseDao<BatchOrdertemEntity> {
    @Select("SELECT *  FROM canteens_batch_ordertem  order by purchase_time ")
    List<BatchOrdertemDTO> getBatchOrdermx();
    @Select("SELECT SUM(unit_price*purchase_num) as totalMoney  FROM canteens_batch_ordertem   ")
    BatchOrdertemDTO  getTotalMoney();
    @Select("delete from canteens_batch_ordertem")
    void   deleteTable();
    @Select("delete from canteens_batch_ordertem where batch_ordertem_id = '${batchOrdertemId}' ")
    void delete1(Long batchOrdertemId);
}